<include file="Public:header" />
<div id="zoneHeader">
    <h2>
        <if condition="$Think.const.ACTION_NAME EQ modify">
        编辑智能广告位
        <else />
        查看智能广告位
        </if>
    </h2>
    <ul>
        <if condition="$Think.const.ACTION_NAME EQ modify">
        <li><button type="button" class="zn_zone-save-btn">保存</button></li>
        </if>
        <li><a href="?m={$Think.const.MODULE_NAME}" class="btn">返回</a></li>
    </ul>
</div><!--/#zoneHeader-->
<style type="text/css">
#zn_zone-edit-container {}
#zn_zone-edit-container p{padding:10px 0 0 100px;}
#zn_zone-show-container {width:100%; border:0;}
</style>
<div id="zoneBody" class="noFooter">
    <div id="zoneBodyContent">
        <form id="formEdit">
            <div id="zn_zone-edit-container">
                <dl class="dl2Col">
                    <dt>广告位名称：</dt>
                    <dd>
                        <input type="text" name="zone_name" class="fW50" />
                        <input name="zone_id" type="hidden" />
                        <div class="formTips2">如果不填写，系统会自动生成广告位名称</div>
                    </dd>
                    <dt>广告样式：</dt>
                    <dd>
                        <label><input type="radio" name="zone_type" value="zn_tw" checked="checked" /><span>图文混合</span></label>
                        <label><input type="radio" name="zone_type" value="zn_text" /><span>纯文字</span></label>
                        <label><input type="radio" name="zone_type" value="zn_color_cloud" /><span>彩色文字</span></label>
                    </dd>
                    <dt g="g_zn_color_cloud">颜色风格：</dt>
                    <dd g="g_zn_color_cloud">
                        <label><input type="radio" name="color_style" value="0" checked="checked" /><span>典雅</span></label>
                        <label><input type="radio" name="color_style" value="1" /><span>清纯</span></label>
                    </dd>
                    <dt>尺寸：</dt>
                    <dd>
                        宽<span name="zone_width"></span> X 高<span name="zone_height"></span>
                        <span class="formTips">图文混合最小尺寸为120x90px，纯文字最小尺寸为100x20px，彩色文字最小尺寸180x30px</span>
                    </dd>
                    <dt>位置：</dt>
                    <dd>
                        <ul>
                            <li><label><input type="radio" name="zone_pos_type" value="0" checked="checked" /><span>无</span></label></li>
                            <li><label><input type="radio" name="zone_pos_type" value="31" /><span>对联</span></label><span class="formTips">对联建议尺寸：宽度最大不超过160px，高度最大不超过600px</span></li>
                            <li><label><input type="radio" name="zone_pos_type" value="32" /><span>右下角漂浮</span></label><span class="formTips">右下角漂浮建议尺寸：宽度和高度最大值都不超过320px<span></li>
                            <li><label><input type="radio" name="zone_pos_type" value="33" /><span>左下角漂浮</span></label><span class="formTips">左下角漂浮建议尺寸：宽度和高度最大值都不超过320px</span></li>
                        </ul>
                    </dd>
                </dl>
                <if condition="$Think.const.ACTION_NAME EQ modify">
                <p class="btnZone"><button type="button" class="zn_zone-save-btn btnEditSave"><b>保存</b></button></p>
                </if>
            </div> <!--/#zone-add2-container--> 
        </form>
    </div><!--/#zoneBodyContent-->
</div><!--/#zoneBody-->

<script type="text/javascript">
$(function() {
    $('.zn_zone-save-btn').on('click', function() {
        $(window).one('ZnZone_doSave', function(e, j) {
            var msg = j.s ? '保存成功' : j.m;

            alert(msg);
        });
        
        ZnZone.doSave($('#formEdit'));
    })

    $('input[name=zone_type]').on('click',function(e){
        var $g = $('[g=g_zn_color_cloud]'),
            action = $(this).val() == 'zn_color_cloud' ? 'show' : 'hide';

        $g[action]();
    })
});
</script>

<script>
$(function(){
    var record = {$record|json_encode};

    Conf.set('formEditDao', record);

    var $g = $('[g=g_zn_color_cloud]'),
        action = '<if condition="$record.zone_type EQ zn_color_cloud">show<else />hide</if>';
 
    $g[action]();

<if condition="$Think.const.ACTION_NAME EQ detail">
$('input').attr('disabled', true);
</if>
})
</script>

<include file="Public:footer" />
